package com.minimalist.common.config.bucket;

import java.util.Objects;

/**
 * @author 11987
 */
public class SystemMetrics{
    private double cpuLoad;
    private double memoryUsage;

    public SystemMetrics() {
    }

    public SystemMetrics(double cpuLoad, double memoryUsage) {
        this.cpuLoad = cpuLoad;
        this.memoryUsage = memoryUsage;
    }

    public double getCpuLoad() {
        return cpuLoad;
    }

    public void setCpuLoad(double cpuLoad) {
        this.cpuLoad = cpuLoad;
    }

    public double getMemoryUsage() {
        return memoryUsage;
    }

    public void setMemoryUsage(double memoryUsage) {
        this.memoryUsage = memoryUsage;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        SystemMetrics that = (SystemMetrics) o;
        return Double.compare(that.cpuLoad, cpuLoad) == 0 &&
                Double.compare(that.memoryUsage, memoryUsage) == 0;
    }

    @Override
    public int hashCode() {
        return Objects.hash(cpuLoad, memoryUsage);
    }

    @Override
    public String toString() {
        return "SystemMetrics{" +
                "cpuLoad=" + cpuLoad +
                ", memoryUsage=" + memoryUsage +
                '}';
    }
}
